from django.db import models


# Create your models here.
class Department(models.Model):
    name = models.CharField(max_length=30, unique=True)

    class Meta:
        db_table = 'department'


class Emp(models.Model):
    name = models.CharField(max_length=30, unique=True)
    age = models.IntegerField()
    dep = models.ForeignKey(Department, on_delete=models.SET_NULL, null=True)

    class Meta:
        db_table = 'emp'
